<?php

	/**
	 * A simple view to provide the user with group filters and the number of group on the site
	 **/
	 
	$num_groups = $vars['count'];
	if(!$num_groups)
		$num_groups = 0;
		
	$filter = $vars['filter'];
	 
	//url
	$url = $vars['url'] . "pg/groups/world/";
	$categories = $vars['config']->site->categories;
	if (empty($categories)) $categories = array();

	if (!empty($categories)) 
	{
		if (!is_array($categories)) $categories = array($categories);
	}
	
?>
<div id="elgg_horizontal_tabbed_nav">
<ul>
	<li <?php if($filter == "all") echo "class='selected'"; ?>><a href="<?php echo $url; ?>?filter=all"><?php echo elgg_echo('UDA_groups:All'); ?></a></li>
	<?php
		foreach($categories as $categorie) 
		{
				echo '<li ' ;
				if($filter == $categorie)
				{
					echo 'class="selected" ';
				}
				echo '><a href="'.$url.'?filter='.$categorie.'">'.elgg_echo($categorie).'</a></li>' ;
		}
	?>
</ul>
</div>
<div class="group_count">
	<?php
		echo $num_groups . " " . elgg_echo("UDA_Groups:count");
	?>
</div>